<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="static/js/layui/css/layui.css" th:href="@{/static/js/layui/css/layui.css}">
    <script rel="script" src="static/js/jquery-3.3.1.min.js" th:src="@{/static/js/jquery-3.3.1.min.js}"></script>
    <script rel="script" src="static/js/layui/layui.js" th:src="@{/static/js/layui/layui.js}"></script>
</head>
<body>
<div class="layui-container">
    <table class="layui-table" th:if="${ info ne null }">
        <tr>
            <th>code</th>
            <th>商品名称</th>
            <th>商品描述</th>
            <th>单位</th>
            <th>数量</th>
            <th>总价</th>
            <th>创建时间</th>
            <th>操作</th>
        </tr>
        <tr th:each="bill : ${ info.list }">
            <td th:text="${bill.billCode}"></td>
            <td th:text="${bill.productName}"></td>
            <td th:text="${bill.productDesc}"></td>
            <td th:text="${bill.productUnit}"></td>
            <td th:text="${bill.productCount}"></td>
            <td th:text="${bill.totalPrice}"></td>
            <td th:text="${#dates.format(bill.creationDate)}"></td>
            <td>
                <a class="layui-btn layui-btn-normal" th:href="@{/bill/show/}">修改</a>
                <a class="layui-btn layui-btn-warm" th:href="@{/bill/delete/{code}(code=${bill.billCode})}" th:onclick="return confirm('确定删除')">删除</a>
            </td>
        </tr>
    </table>
    <div class="layui-btn-group layui-bg-blue">
        <a class="layui-btn layui-btn-normal" th:href="@{/bill/find/{index}/{size}(index=${info.pageNum-1},size=${info.pageSize})}">上一页</a>
        <a th:class="${info.pageNum==i}?'layui-btn':'layui-btn layui-btn-warm'" th:href="@{/bill/find/{index}/{size}(index=${i},size=${info.pageSize})}" th:each="i:${info.navigatepageNums}" th:text="${i}"></a>
        <a class="layui-btn layui-btn-normal" th:href="@{/bill/find/{index}/{size}(index=${info.pageNum+1},size=${info.pageSize})}">下一页</a>
    </div>
</div>
</body>
</html>